//
//  UIButton+Extension.swift
//  joyBao
//
//  Created by Chen on 2017/8/17.
//  Copyright © 2017年 Chen. All rights reserved.
//

import Foundation
import RxCocoa
import RxSwift

extension UIButton {

    func touchUpInsideCallback(_ callback: @escaping () -> Swift.Void) {
        self.rx.tap.subscribe { (event: Event) in
            switch event {
            case .next(_):
                callback()
                break
            default:
                break
            }
        }.addDisposableTo(bag)
    }

}
